<!-- 申请结果页 -->
<template>
  <view v-if="shenheStatus == 0 && requestEnd" class="result-page">
    <view class="result-section">
      <view class="pending">
        <block>
          <image @click="imgClick(url)"  :src="url"></image>
          <view>请商户进行扫码授权操作</view>
        </block>
      </view>
    </view>
  </view>
  <Shenhe v-else-if="shenheStatus == 1"></Shenhe>
</template>

<script>
import Shenhe from "@/components/shenhe/shenhe";
export default {
  components: {Shenhe },
  data() {
    return {
      storeId: 0,
      url: '',
      requestEnd: false,
    };
  },
  onLoad(t) {
    if (t.id) {
      this.storeId = t.id
    }
    this.getParams();
    this.requestEnd = true;

  },
  computed: {},
  onShow() {},
  watch: {},
  methods: {
    async getParams() {
      const res = await this.$allrequest.newStore.GetParam(
          {
            bind_store_id: this.storeId
          }
      );
      if (parseInt(res.code) === 0) {
        this.url = res.url;
      }
    },
    imgClick(url) {
      uni.previewImage({
        current: 0,
        urls: [url]
      })
    }
  },
  onUnload() {
    // if (this.timer) clearInterval(this.timer);
  },
};
</script>

<style lang="scss" scoped>
.result-page {
  width: 100%;
  background: #f2f2f2;
  min-height: 100vh;
  .result-section {
    background: #ffffff;
    .pending {
      padding-top: 30rpx;
      padding-bottom: 70rpx;
      display: flex;
      flex-direction: column;
      align-items: center;
      image {
        width: 500rpx;
        height: 500rpx;
      }
      view {
        width: 100%;
        text-align: center;
        line-height: 48rpx;
        font-size: 30rpx;
        padding-top: 20rpx;
      }
    }
  }
  .page-btn {
    width: 678rpx;
    height: 88rpx;
    background: #f0250e;
    border-radius: 44rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32rpx;
    font-family: PingFang SC;
    font-weight: 500;
    color: #ffffff;
    margin: 80rpx auto 40rpx;
  }
}
</style>
